//
// Created by Administrator on 2024/6/14.
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hookfunc_main.h"

extern int egRegGetStudentsInfoFunc(GET_SUTDENTS_NAME_INFO_Fucptr pGetStudentsInfoFuc);
extern void getStudentsInfoEntry();

T_STUDENTS_INFO g_StudentsInfo;

void getStudentsName(char *pbuf,STUDENTS_INFO_NUM sutdentsNum)
{
    if(sutdentsNum == STUDENTS_111)
    {
        memcpy(g_StudentsInfo.sutdents_111_name,pbuf,strlen(pbuf));
    }

    if(sutdentsNum == STUDENTS_222)
    {
        memcpy(g_StudentsInfo.sutdents_222_name,pbuf,strlen(pbuf));
    }

    if(sutdentsNum == STUDENTS_333)
    {
        memcpy(g_StudentsInfo.sutdents_333_name,pbuf,strlen(pbuf));
    }

}

int callback_function_register(void)
{
    int retVaule = egRegGetStudentsInfoFunc(getStudentsName);
    return retVaule;
}

int main21()
{
    memset(&g_StudentsInfo,'\0',sizeof(T_STUDENTS_INFO));
    callback_function_register();
    getStudentsInfoEntry();
    printf("sutdents_111_name = %s\n",g_StudentsInfo.sutdents_111_name);
    printf("sutdents_222_name = %s\n",g_StudentsInfo.sutdents_222_name);
    printf("sutdents_333_name = %s\n",g_StudentsInfo.sutdents_333_name);
    return 0;
}